package wqldistinctlocktest.distinctlock.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import wqldistinctlocktest.distinctlock.service.StockService;
import wqldistinctlocktest.distinctlock.service.StockService_redis;
import wqldistinctlocktest.distinctlock.service.StockService_redission;
import wqldistinctlocktest.distinctlock.service.StockService_syn;

/**
 * @author wql
 * @version 1.0
 * @date 2022/12/8 16:34
 */

@RestController
public class StockController {

    @Autowired
    private StockService_redission stockService;

    //根据商品编号减库存
    @GetMapping("/incr/{productid}")
    public String incr(@PathVariable Integer productid){
        return stockService.decrement(productid);
    }
}
